Custom Fields Values

Read values

Custom fields are identified by their definitionKey.

The following query returns the Event custom field values together with some metadata about the Custom Field:

Example

query {
  events {
    edges {
      node {
        id
        code
        customFieldValues {
          definition{
            key
            label
          }
          value
        }
      }
    }
  }
}

Example response:

{
  "data": {
    "events": {
      "edges": [
        {
          "node": {
            "id": "Q291cnNlOjE=",
            "code": "REACT1",
            "customFieldValues": [
              {
                "definition": {
                  "key": "Q3VzdG9tRmllbGREZWZpbml0aW9uOjIw",
                  "label": "Door code"
                },
                "value": null
              },
              {
                "definition": {
                  "key": "Q3VzdG9tRmllbGREZWZpbml0aW9uOjI2",
                  "label": "Attire"
                },
                "value": "Smart casual"
              }
            ]
          }
        }
      ]
    }
  }
}

Filter values

If only certain Custom Field values are required, it is possible to filter for a specific one:

query {
  events {
    edges {
      node {
        id
        code
        customAlias: customFieldValues(filter:{definitionKey: "Q3VzdG9tRmllbGREZWZpbml0aW9uOjI2"}) {
          definition {
            key
            label
          }
          value
        }
      }
    }
  }
}

Example response:

{
  "data": {
    "events": {
      "edges": [
        {
          "node": {
            "id": "Q291cnNlOjE=",
            "code": "ACCG1-UK",
            "customAlias": []
          }
        },
        {
          "node": {
            "id": "Q291cnNlOjM=",
            "code": "EXCDASH-NL",
            "customAlias": []
          }
        },
      ]
    }
  }
}

Set values

The following mutation updates the Event custom field values:

Example

mutation {
  event {
    update(
      eventId: "Q291cnNlOjE=",
      input: {
        customFieldValues: [
          {
              definitionKey: "Q3VzdG9tRmllbGREZWZpbml0aW9uOjIw",
              value: "Lorem ipsum dolor sit amet..."
          },
          {
              definitionKey: "Q3VzdG9tRmllbGREZWZpbml0aW9uOjI2",
              value: "Smart"
          }
        ]
      }
      ) {
      event {
        id
        customFieldValues {
          definition{
            key 
            label
          }
          value
        }
      }
      errors {
        label
        value
        message
      }
    }
  }
}